package com.personal.bo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;


@ApiModel(value = "AddResourcesBO",description = "添加资源文章bo")
@Data
public class AddResourcesBO {

    @ApiModelProperty(value = "用户id",example = "7")
    @NotNull(message = "用户id不能为空")
    private Integer userId;

    @ApiModelProperty("资源标题")
    @NotNull(message = "资源标题不能为空")
    private String name;

    @ApiModelProperty(value = "分类id", example = "1")
    @NotNull(message = "分类id不能为空")
    private Integer catId;

    @ApiModelProperty("资源内容")
    @NotNull(message = "资源内容不能为空")
    private String content;

    @ApiModelProperty("资源地址")
    @NotNull(message = "资源地址不能为空")
    private String url;

    @ApiModelProperty("原价")
    @NotNull(message = "价格不能为空")
    private Integer priceNormal;

    @ApiModelProperty("会员价格")
    private String priceVip;

    public AddResourcesBO(){
        this.priceVip = priceVip == null ? "免费" : priceVip;
    }
}
